<?php

namespace App\Models;


/**
 * App\Models\Doctor
 *
 * @property int $id
 * @property int|null $user_id 用户id
 * @property int|null $department_id 科室id
 * @property string|null $department_name 科室名称
 * @property string|null $avatar 头像
 * @property string|null $name 名字
 * @property string|null $positions 职位
 * @property string|null $hospital 在职医院
 * @property int|null $price 价格/次
 * @property int|null $visits_num 接诊数
 * @property string|null $skilled 擅长/个人简介
 * @property string|null $phone 手机号码
 * @property string|null $id_num 身份证号码
 * @property string|null $cert_img 证书图片
 * @property int|null $is_rec 推荐（1：推荐，0：不推荐）
 * @property int|null $status 审核（0：待审核，1：审核成功，2：审核失败）
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor query()
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereAvatar($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereCertImg($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereDepartmentId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereDepartmentName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereHospital($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereIdNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereIsRec($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor wherePositions($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor wherePrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereSkilled($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Doctor whereVisitsNum($value)
 * @mixin \Eloquent
 */
class Doctor extends Base
{
    protected $table = 'doctor';

    // 获取首页底部推荐医师
    static function getIndexRec()
    {
        return self::whereIsRec(1)->limit(5)->get([
            'department_id', 'department_name', 'avatar',
            'name', 'positions', 'hospital',
            'price', 'visits_num', 'skilled',
            'id'
        ]);
    }
}
